package com.df.common;

import com.df.msgs.Req_Login;
import com.df.msgs.Req_Move;
import com.df.msgs.Resp_Login;

public enum MsgDefine {
    Req_Login(1, Req_Login.class),
    Resp_Login(2, Resp_Login.class),
    Req_Move(3, Req_Move.class);

    MsgDefine(Integer msgId, Class clazz) {
        this.msgId = msgId;
        this.clazz = clazz;
    }
    public Integer msgId;
    public Class clazz;

    public static Class getMsgClass(Integer msgId) {
        for (MsgDefine value : MsgDefine.values()) {
            if(value.msgId.equals(msgId)){
                return value.clazz;
            }
        }
        return null;
    }
}
